<%@ Page Language="C#" MasterPageFile="~/Employee.master" AutoEventWireup="true" CodeFile="AddDelivery.aspx.cs" Inherits="Pages_Employee_ManageDeliveries_AddDelivery" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:Label ID="Label1" runat="server" Font-Bold="True" Text="Add Delivery" CssClass="header"></asp:Label>
<br />
<br />
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" />
    <table border="1" class="table01">
        <tr>
            <td style="width: 125px; height: 20px">
                <strong>Customer ID</strong></td>
            <td style="height: 20px; width: 328px;">
                <asp:TextBox ID="txtCustomerID" runat="server" MaxLength="12" onkeyup="idChecker(this.value);"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtCustomerID"
                    ErrorMessage="Customer ID is required">*</asp:RequiredFieldValidator>
                <span id="spanAlert"></span>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtCustomerID"
                    ErrorMessage="Customer ID must be a positive integer" ValidationExpression="^[1-9][0-9]*$">*</asp:RegularExpressionValidator>
                </td>
        </tr>
        <tr>
            <td></td>
            <td style="padding-left:5px"><asp:HyperLink ID="lnkNewCustomer" runat="server" NavigateUrl="~/Pages_Employee/ManageCustomers/AddCustomer.aspx">New Customer</asp:HyperLink></td>
        </tr>
        <tr>
            <td style="width: 125px">
                <strong>Type</strong></td>
            <td style="width: 328px">
                <asp:DropDownList ID="ddlType" runat="server">
                    <asp:ListItem>Mail</asp:ListItem>
                    <asp:ListItem>Package</asp:ListItem>
                </asp:DropDownList></td>
        </tr>
        <tr>
            <td style="width: 125px; height: 20px;">
                <strong>Service</strong></td>
            <td style="width: 328px; height: 20px;">
                <asp:DropDownList ID="ddlService" runat="server" DataSourceID="servicesDataSource" DataTextField="ServiceName" DataValueField="ServiceID">
                </asp:DropDownList><asp:ObjectDataSource ID="servicesDataSource" runat="server" OldValuesParameterFormatString="original_{0}"
                    SelectMethod="ListService" TypeName="DALService"></asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td style="width: 125px">
                <strong>Weight</strong></td>
            <td style="width: 328px">
                <asp:TextBox ID="txtWeight" runat="server" MaxLength="400" Width="55px"></asp:TextBox>
                grams
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtWeight"
                    ErrorMessage="Weight is required">*</asp:RequiredFieldValidator>
                <asp:CustomValidator ID="CustomValidator2" runat="server" ControlToValidate="txtWeight"
                    ErrorMessage="Weight must be a decimal greater than zero" OnServerValidate="CustomValidator2_ServerValidate">*</asp:CustomValidator></td>
        </tr>
        <tr>
            <td style="width: 125px">
                <strong>Distance</strong></td>
            <td style="width: 328px">
                <asp:DropDownList ID="ddlDistance" runat="server" DataSourceID="distancesDataSource" DataTextField="Description" DataValueField="DistanceID">
                </asp:DropDownList><asp:ObjectDataSource ID="distancesDataSource" runat="server"
                    SelectMethod="GetDistances" TypeName="DALDistance"></asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td style="width: 125px">
                <strong>Receiver Name</strong></td>
            <td style="width: 328px">
                <asp:TextBox ID="txtReceiverName" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtReceiverName"
                    ErrorMessage="Receiver Name is required">*</asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td style="width: 125px">
                <strong>Receiver Address</strong></td>
            <td style="width: 328px">
                <asp:TextBox ID="txtReceiverAddress" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtReceiverAddress"
                    ErrorMessage="Receiver Address is required">*</asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td style="width: 125px">
                <strong>Receiver City</strong></td>
            <td style="width: 328px">
                <asp:DropDownList ID="ddlReceiverCity" runat="server" DataSourceID="citiesDataSource" DataTextField="CityName" DataValueField="CityID">
                </asp:DropDownList><asp:ObjectDataSource ID="citiesDataSource" runat="server" OldValuesParameterFormatString="original_{0}"
                    SelectMethod="ListCity" TypeName="DALCity"></asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td style="width: 125px">
            </td>
            <td style="width: 328px">
                <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
                &nbsp; &nbsp;
                <asp:Button ID="btnReset" runat="server" Text="Reset" OnClick="btnReset_Click" /></td>
        </tr>
    <tr>
        <td colspan="2">
            <asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="Please check the following errors" />
            <br />
            <asp:Label ID="lblMessage" runat="server"></asp:Label>
            <asp:LinkButton ID="lnkInvoice" runat="server" OnClick="lnkInvoice_Click"></asp:LinkButton></td>
    </tr>
    </table>
    
    <script type="text/javascript" src="../../Scripts/checkid.js"></script>
</asp:Content>

